package com.ffyc.cms.service;


import com.ffyc.cms.dao.FriendlinkDao;
import com.ffyc.cms.model.Friendlink;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class FriendlinkService {
    @Autowired
    FriendlinkDao friendlinkDao;
/*获取友情链接*/
    public List<Friendlink> getfriendlinklist() {
        return friendlinkDao.getfriendlinklist();
    }

    public boolean findLinkName(String linkname) {
        int num = friendlinkDao.findLinkName(linkname);
        return num==0;
    }

    public void savefriendlink(Friendlink friendlink) {
        friendlinkDao.savefriendlink(friendlink);
    }

    public Friendlink getLinkById(Integer id) {
        return friendlinkDao.getLinkById(id);
    }

    public void updatefriendlink(Friendlink friendlink) {
        friendlinkDao.updatefriendlink(friendlink);
    }
}
